package com.qf.microgoods.goods.controller;

/**
 * 天--道--酬--勤
 *
 * @author LiangGaoQiang
 * @ClassName GrassFavoriteController
 * @Date: 2025/6/1 18:02
 * @Description: 描述
 */

import com.qf.common.core.common.R;
import com.qf.microgoods.goods.param.FavoriteParam;
import com.qf.microgoods.goods.service.FavoriteService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 收藏功能
 */
@RestController
@RequestMapping("/Goods")
public class FavoriteController {

    @Resource
    private FavoriteService grassFavoriteService;

    @PostMapping("/createFavorite")
    public R addFavorite(@RequestBody FavoriteParam favoriteParam) {
        boolean result = grassFavoriteService.addFavorite(favoriteParam);
        if (result){
            return R.ok("收藏成功");
        }
        return R.fail("收藏失败");
    }

}
